package model

import (
	"gorm.io/gorm"
	"time"
)

type BaseModel struct {
	ID        int32     `gorm:"primarykey"`
	CreatedAt time.Time `gorm:"column:add_time;comment:创建时间"`
	UpdatedAt time.Time `gorm:"column:update_time;comment:更新时间"`
	DeletedAt gorm.DeletedAt
	IsDeleted bool
}

type User struct {
	BaseModel
	Mobile   string     `gorm:"type:varchar(11);unique;comment:手机号"`
	Password string     `gorm:"type:varchar(100);not null;comment:密码"`
	NickName string     `gorm:"type:varchar(20);comment:用户昵称"`
	Birthday *time.Time `gorm:"type:datetime;"`
	Gender   string     `gorm:"column:gender;default:male;type:varchar(6);comment:female表示女性,male表示男性"`
	Role     int        `gorm:"column:role;default:1;type:smallint;comment:1表示普通用户,2管理员用户"`
}
